#include <iostream>
#include <complex>

using namespace std;
typedef complex<double> cpx;
typedef struct {double real, imag;} komplex;

int main(int argc, char** argv){
  komplex *a;
  cpx *b;
//  a = new komplex[3];
  b = new cpx[3];

  b[0] = cpx(1.0,2.0);
  b[1] = cpx(2.0,4.0);
  b[2] = cpx(3.0,6.0);

  a = reinterpret_cast<komplex*>(b);
  cerr << "a[0].real = " << a[0].real << endl;
  cerr << "a[0].imag = " << a[0].imag << endl;
  cerr << "a[1].real = " << a[1].real << endl;
  cerr << "a[1].imag = " << a[1].imag << endl;
  cerr << "a[2].real = " << a[2].real << endl;
  cerr << "a[2].imag = " << a[2].imag << endl;
//  delete []a;
  delete []b;
  return 1;

}

